#!/usr/bin/python
import sys
#collaborators: Sana Imam

#introduce new structures to appease Jack 
class Point: 
	x = 0
	y = 0

	def __init__(self, x, y):
		self.x = x
		self.y = y


class Vector: 
	xCompon = 0
	yCompon = 0 

	#vector from A to B
	def __init__(self, pointA, pointB):
		self.xCompon = pointB.x - pointA.x 
		self.yCompon = pointB.y - pointA.y 


class Segment:
	firstPoint = Point(0, 0)
	secondPoint = Point(0, 0)

	def __init__(self, pointA, pointB):
		self.firstPoint = pointA
		self.secondPoint = pointB


def outerProduct(vectorA, vectorB):
	return (vectorA.xCompon * vectorB.yCompon) - (vectorA.yCompon * vectorB.xCompon)


def determineIfIntersects(segmentA, segmentB):
	#see CLRS 33 for more info. 
	P_R = Vector(segmentA.firstPoint, segmentB.firstPoint)
	P_S = Vector(segmentA.firstPoint, segmentB.secondPoint)
	P_Q = Vector(segmentA.firstPoint, segmentA.secondPoint)
	Q_R = Vector(segmentA.secondPoint, segmentB.firstPoint)
	S_R = Vector(segmentB.secondPoint, segmentB.firstPoint)

	PR_times_PQ = outerProduct(P_R,P_Q)
	PS_times_PQ = outerProduct(P_S,P_Q)
	PR_times_SR = outerProduct(P_R,S_R)
	QR_times_SR = outerProduct(Q_R,S_R)

	return (PR_times_PQ * PS_times_PQ <0 and PR_times_SR * QR_times_SR <0)


with open(sys.argv[1], 'r') as testFile:
  firstLine = testFile.readline()
  numberOfRed = int(firstLine.split()[0])
  numberOfBlue = int(firstLine.split()[1])
  numberOfProposedCrosses = int(firstLine.split()[2])

  redLines = []
  blueLines = []

  for incrementer in range(0,numberOfRed):
  	nextLine = testFile.readline()
  	redLines.append([nextLine.split()[0],nextLine.split()[1],nextLine.split()[2],nextLine.split()[3]])

  for incrementer in range(0,numberOfBlue):
  	nextLine = testFile.readline()
  	blueLines.append([nextLine.split()[0],nextLine.split()[1],nextLine.split()[2],nextLine.split()[3]])

numberOfCrossesFound = 0
for redLine in redLines: 
	for blueLine in blueLines:

		redA = Point(int(redLine[0]),int(redLine[1]))
		redB = Point(int(redLine[2]),int(redLine[3]))
		blueA = Point(int(blueLine[0]),int(blueLine[1]))
		blueB = Point(int(blueLine[2]),int(blueLine[3]))

		redSegment = Segment(redA, redB)
		blueSegment = Segment(blueA, blueB)

		if determineIfIntersects(redSegment,blueSegment):
			numberOfCrossesFound+=1

if numberOfCrossesFound == numberOfProposedCrosses: 
	print 'VERIFIED'

